package stool.compositepattern;

/**
 * @Author Felix YF Dong
 * @Date 2021/5/11
 */
public class Main {

    public static void main(String[] args) {

        ConcreteCompany root = new ConcreteCompany("北京总公司");
        root.create(new HRDepartment("北京总公司HRD"));
        root.create(new FinanceDepartment("北京总公司FinanceD"));

        ConcreteCompany comp = new ConcreteCompany("上海分公司");
        comp.create(new HRDepartment("上海分公司HRD"));
        comp.create(new FinanceDepartment("上海分公司FinanceD"));

        ConcreteCompany comp1 = new ConcreteCompany("南京办事处");
        comp1.create(new HRDepartment("南京办事处HRD"));
        comp1.create(new FinanceDepartment("南京办事处FinanceD"));

        ConcreteCompany comp2 = new ConcreteCompany("杭州办事处");
        comp2.create(new HRDepartment("杭州办事处HRD"));
        comp2.create(new FinanceDepartment("杭州办事处FinanceD"));

        comp.create(comp1);
        comp.create(comp2);
        root.create(comp);

        root.find(1);
        root.lineOfDuty();


    }
}
